package com.power.ba01;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

import java.util.Date;

/**
 * 张尧
 * 2020/12/15
 */
@Aspect
public class myAspect {

    @Before(value = "execution(* *..SomeServiceImpl.doSome(..))")
    public void myBefore(JoinPoint jp){
        System.out.println("方法的签名="+jp.getSignature());
        System.out.println("方法的名称="+jp.getSignature().getName());
        Object args [] =jp.getArgs();
        for (Object arg:args){
            System.out.println("参数="+arg);
        }
        //就是你切面要执行的功能代码
        System.out.println("2=====前置通知， 切面功能：在目标方法之前输出执行时间："+ new Date());
    }
}
